package com.lg.erp.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lg.erp.entity.SCompany;
import com.lg.erp.mapper.SCompanyMapper;
import com.lg.erp.service.ISCompanyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lg
 * @since 2021-04-20
 */
@Service
public class SCompanyServiceImpl extends ServiceImpl<SCompanyMapper, SCompany> implements ISCompanyService {

    @Autowired
    private SCompanyMapper companyMapper;
    @Override
    public IPage<SCompany> getCompanyByPage(Page<SCompany> page) {
            return companyMapper.selectCompanyByPage(page);
    }

    @Override
    public IPage<SCompany> getCompanyByCompanyNameAndPage(String keyWord, String province, String city, String area, Page<SCompany> page) {
        return companyMapper.searchCompanyByCompanyNameAndPage(keyWord,province,city,area,page);
    }

    @Override
    public IPage<SCompany> getSupplierByPage(Page<SCompany> page) {
        return companyMapper.selectSupplierByPage(page);
    }

    @Override
    public IPage<SCompany> getSupplierByCompanyNameAndPage(String s, String s1, String s2, String s3, Page<SCompany> page) {
        return companyMapper.searchSupplierByCompanyNameAndPage(s,s1,s2,s3,page);
    }

    @Override
    public IPage<SCompany> getSupplierByPageAndCompanyId(Page<SCompany> page, String companyId) {
        return companyMapper.selectSupplierByPageAndCompanyId(page, companyId);
    }

    @Override
    public IPage<SCompany> getSupplierBySupplierNameAndPage(String keyWord, String province, String city, String area, Page<SCompany> page, String companyId) {
        return companyMapper.searchSupplierBySupplierNameAndPage(keyWord, province, city, area, page, companyId);
    }

}
